//
//  NSDate+Util.m
//  PeopleLog
//
//  Created by Justin Kim on 11. 6. 17..
//  Copyright 2011 Daum. All rights reserved.
//

#import "NSDate+Util.h"


@implementation NSDate (Util)




+(id)dateWithYear:(int)year month:(int)month day:(int)day{
    return [self dateWithYear:year month:month day:day hour:0 minute:0 second:0];
}

+(id)dateWithYear:(int)year month:(int)month day:(int)day hour:(int)hour minute:(int)minute second:(int)second{
    NSDateComponents *com = [[NSDateComponents alloc] init];
    [com setYear:year];
    [com setMonth:month];
    [com setDay:day];
    [com setHour:hour];
    [com setMinute:minute];
    [com setSecond:second];
    
    NSDate *resultDate = [[NSCalendar currentCalendar] dateFromComponents:com];
    [com release];
    return resultDate;
}

@end
